using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace InfFront.InfoViews.WinForms.Controls
{
    public partial class DataGrid : System.Windows.Forms.DataGrid
    {
        public DataGrid()
        {
            InitializeComponent();
        }

        #region Table Styles
        private class DataGridCollectionEditor : CollectionEditor
        {
            public DataGridCollectionEditor(Type type)
                : base(type)
            {
            }

            protected override System.Type[] CreateNewItemTypes()
            {
                return new Type[] { typeof(DataGridTableStyle) };
            }
        }

        [Editor( typeof( DataGridCollectionEditor ), typeof( System.Drawing.Design.UITypeEditor ) )]
        public new GridTableStylesCollection TableStyles
        {
            get
            {
                return base.TableStyles;
            }
        }
        #endregion
    }

    public class DataGridTableStyle : System.Windows.Forms.DataGridTableStyle
    {
        #region Nested classes
        private class TableStyleCollectionEditor : CollectionEditor
        {
            public TableStyleCollectionEditor(Type type)
                : base(type)
            {
            }

            protected override System.Type[] CreateNewItemTypes()
            {
                return new Type[]
                {
                    typeof(DataGridTextBoxColumn),
                    typeof(DataGridBoolColumn)
                };
            }
        }
        #endregion

        #region Properties
        [Editor(typeof(TableStyleCollectionEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public new GridColumnStylesCollection GridColumnStyles
        {
            get
            {
                return base.GridColumnStyles;
            }
        }
        #endregion
    }

    public class DataGridTextBoxColumn : System.Windows.Forms.DataGridTextBoxColumn
    {
    }

    public class DataGridBoolColumn : System.Windows.Forms.DataGridBoolColumn
    {
    }
}
